using System;
using System.ComponentModel.DataAnnotations.Schema;
using UwinEducation.Shared.Enums;

namespace UwinEducation.Domain.Entities
{
    /// <summary>
    /// 学生实体
    /// </summary>
    [Table("basic_students")]
    public class Student : EntityBase
    {
        public Guid Id { get;  set; }
        /// <summary>
        /// 学号
        /// </summary>
        public string StudentNo { get; set; }

        /// <summary>
        /// 姓名
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 学校
        /// </summary>
        public string School { get; set; }

        /// <summary>
        /// 年级
        /// </summary>
        public GradeEnum Grade { get; set; }

        /// <summary>
        /// 入学日期
        /// </summary>
        public int EnrollmentDate { get; set; }
        
        /// <summary>
        /// 电话
        /// </summary>
        public string Phone { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        public string Email { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remarks { get; set; }

        

        /// <summary>
        /// 创建学生
        /// </summary>
        public static Student Create(string studentNo, string name, string school, int enrollmentDate, string remarks = null, string phone = null, string email = null)
        {
            return new Student
            {
                Id = Guid.NewGuid(),
                StudentNo = studentNo,
                Name = name,
                School = school,
                EnrollmentDate = enrollmentDate,
                Remarks = remarks,
                Phone = phone,
                Email = email,
                CreatedAt = DateTime.Now
            };
        }
    }
}